package com.weihj;

import com.weihj.entity.Iuser;
import com.weihj.mapper.IuserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@SpringBootApplication
@Slf4j
@RestController
public class LogbackStarterApplication {

	public static void main(String[] args) {
		SpringApplication.run(LogbackStarterApplication.class, args);
	}

	@Value("${log.path}")
	private String logpath;
	@Autowired
	private IuserMapper iuserMapper;

	@RequestMapping("/test1")
	void test1() {
		log.trace("trace");
		log.debug("debug");
		log.info("info");
		log.warn("warn");
		log.error("error");
		log.info(logpath);
	}

	@RequestMapping("/a")
	List<Iuser> listUser() {
		return iuserMapper.selectAll();
	}
}
